package com.jinke.api.modules.third.shippo.model.dto;


import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;
/**
 * 创建shippo的面单
 */

@Data
@Accessors(chain = true)
public class ShippoLableCreateDTO {

    private Extra extra;
    private String metadata;
    private String shipmentDate;
    private Address addressFrom;
    private Address addressReturn;
    private Address addressTo;
    private CustomsDeclaration customsDeclaration;
    private boolean async;
    private List<String> carrierAccounts;
    private List<Parcel> parcels;

    @Data
    public static class Extra {
        private AccountsReceivableCustomerAccount accountsReceivableCustomerAccount;
        private Alcohol alcohol;
        private String ancillaryEndorsement;
        private AppropriationNumber appropriationNumber;
        private boolean authorityToLeave;
        private BillOfLadingNumber billOfLadingNumber;
        private Billing billing;
        private boolean bypassAddressValidation;
        private boolean carbonNeutral;
        private String carrierHubId;
        private int carrierHubTravelTime;

        private CodNumber codNumber;
        private String containerType;
        private String criticalPullTime;
        private String customerBranch;
        private CustomerReference customerReference;
        private DangerousGoods dangerousGoods;
        private String dangerousGoodsCode;
        private DealerOrderNumber dealerOrderNumber;
        private String deliveryInstructions;
        private DeptNumber deptNumber;
        private DryIce dryIce;
        private FdaProductCode fdaProductCode;
        private String fulfillmentCenter;
        private Insurance insurance;
        private InvoiceNumber invoiceNumber;
        private boolean isReturn;
        private List<String> lasershipAttrs;
        private String lasershipDeclaredValue;
        private ManifestNumber manifestNumber;
        private String modelNumber;
        private String partNumber;
        private PoNumber poNumber;
        private String preferredDeliveryTimeframe;
        private boolean premium;
        private ProductionCode productionCode;
        private PurchaseRequestNumber purchaseRequestNumber;
        private boolean qrCodeRequested;
        private String reference1;
        private String reference2;
        private boolean requestRetailRates;
        private String returnServiceType;
        private RmaNumber rmaNumber;
        private boolean saturdayDelivery;
        private SalespersonNumber salespersonNumber;
        private String serialNumber;
        private String signatureConfirmation;
        private String storeNumber;
        private TransactionReferenceNumber transactionReferenceNumber;
    }

    @Data
    public static class AccountsReceivableCustomerAccount {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class Alcohol {
        private boolean containsAlcohol;
        private String recipientType;
    }

    @Data
    public static class Cod {
        private String amount;
        private String currency;
        @JSONField(name = "payment_method")
        private String paymentMethod;
    }

    @Data
    public static class CodNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class Billing {
        private String account;
        private String country;
        private String participationCode;
        private String type;
        private String zip;
    }

    @Data
    public static class CustomerReference {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class DangerousGoods {
        private boolean contains;
        private BiologicalMaterial biologicalMaterial;
        private LithiumBatteries lithiumBatteries;
    }

    @Data
    public static class BiologicalMaterial {
        private boolean contains;
    }

    @Data
    public static class LithiumBatteries {
        private boolean contains;
    }

    @Data
    public static class DealerOrderNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class InvoiceNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class PoNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class RmaNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class SalespersonNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class TransactionReferenceNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class AppropriationNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class BillOfLadingNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class DeptNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class DryIce {
        private boolean containsDryIce;
        private String weight;
    }

    @Data
    public static class FdaProductCode {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class ManifestNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class ProductionCode {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class PurchaseRequestNumber {
        private String prefix;
        private String value;
        private int refSort;
    }

    @Data
    public static class Address {
        private String name;
        private String company;
        private String street1;
        private String street2;
        private String street3;
        private String streetNo;
        private String city;
        private String state;
        private String zip;
        private String country;
        private String phone;
        private String email;
        private boolean isResidential;
        private String metadata;
        private boolean validate;
    }

    @Data
    public static class CustomsDeclaration {
        private String aesItn;
        private String b13aFilingOption;
        private String b13aNumber;
        private String certificate;
        private boolean certify;
        private String certifySigner;
        private boolean commercialInvoice;
        private String contentsExplanation;
        private String disclaimer;
        private ExporterIdentification exporterIdentification;
        private String exporterReference;
        private String importerReference;
        private boolean isVatCollected;
        private String invoice;
        private String license;
        private String metadata;
        private String notes;
        private Address addressImporter;
        private String contentsType;
        private String eelPfc;
        private String incoterm;
        private List<Item> items;
        private String nonDeliveryOption;
        private boolean test;
    }

    @Data
    public static class ExporterIdentification {
        private String eoriNumber;
        private TaxId taxId;
    }

    @Data
    public static class TaxId {
        private String number;
        private String type;
    }

    @Data
    public static class Item {
        private String description;
        private String eccnEar99;
        private String massUnit;
        private String metadata;
        private String netWeight;
        private String originCountry;
        private int quantity;
        private String skuCode;
        private String hsCode;
        private String tariffNumber;
        private String valueAmount;
        private String valueCurrency;
    }

    @Data
    public static class Parcel {
        //private Extra extra;
        //
        private ParcelExtra extra;
        private String metadata;
        private String massUnit;
        private String weight;
        private String distanceUnit;
        private String height;
        private String length;
        private String width;
    }

    @Data
    public static class Insurance {
        private String amount;
        private String content;
        private String currency;
        private String provider;
    }

    @Data
    public static class ParcelExtra {
        @JSONField(name = "COD")
        private Cod cod;
        private Insurance insurance;
        @JSONField(name = "reference_1")
        private String reference1;
        @JSONField(name = "reference_2")
        private String reference2;
    }

}
